# +----------------------------------------------------------------------
# | User: zq
# | Version: python3.7
# | Time: 2020-03-07 21:36
# +----------------------------------------------------------------------
from bs4 import BeautifulSoup
import re

html = """
<title>hello</title>
<body>
    <div id="info">
        <p style="color:blue">讲师信息</p>
        <div class="teacher_info info">
            python全栈工程师,7年工作经验,喜欢钻研python技术,对爬虫,web开发以及机器学习有浓厚的兴趣,关注前沿技术以及发展趋势.
            <p class="age">年龄: 29</p>
            <p class="name">姓名: bobby</p>
            <p class="work_years">工作年限: 7年</p>
            <p class="position">职位:python开发工程师</p>
        </div>
    </div>
</body>
"""

from scrapy import Selector

sel = Selector(text=html)
name_xpath = "//*[@id='info']/div/p[1]/text()"
tag = sel.xpath(name_xpath).extract()[0]
pass
